<template>
  <div class="persion-box">
    <el-row>
      <el-col :span="6" :offset="4">
        <el-button class="pa0" @click="openPublish">
          <div type="text" class="br1 h4 w4 dib material-icons v-mid ba bw1 border-box items-center justify-center inline-flex">
            <i class="f1 material-icons">add</i>
          </div>
        </el-button>
      </el-col>
      <el-col :span="14">
        <a type="text" class="pointer" @click="openAccountSet">
        <el-row class="bg-near-white">
          <el-col :span="7">
            <img :src="user.avatar" class="br1 h4 w4 dib v-mid" alt="avatar">
          </el-col>
          <el-col :span="15" :offset="1">
            <ul class="list pl0">
              <li class="truncate">
                <b>
                    姓名
                  </b> {{user.nickname}}
              </li>
              <li class="mt2 truncate">
                <b>
                    相机
                  </b> {{user.camera}}
              </li>
              <li class="mt2 text-over">
                <b>
                    介绍
                  </b>
                <span class="f6 ">{{user.intro}}</span>
              </li>
            </ul>
          </el-col>
        </el-row>
        </a>
      </el-col>
    </el-row>
    <publish-dailog ref="publish"/>
    <account-set-dailog ref="account" />
  </div>
</template>

<script>
import PublishDailog from '@/components/Publish';
import AccountSetDailog from '@/components/AccountSet';
import { mapState } from 'vuex';

export default {
  name: 'Presion',
  data() {
    return {

    };
  },
  computed: {
    uploadHeaders() {
      return {
        'x-csrf-token': this.$store.state.glob.csrf,
      };
    },
    ...mapState({
      user: state => state.user.info,
    }),
  },
  methods: {
    openPublish() {
      this.$refs.publish.show();
    },
    openAccountSet() {
      this.$refs.account.show();
    },
  },

  components: {
    PublishDailog,
    AccountSetDailog,
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .persion-box {
    margin: 20px auto;
  }

  .text-over {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .pa0 {
    padding: 0;
  }
</style>

<style lang="scss">
  .persion-box {
    .list{
      margin-top: 5px;
    }
    .el-upload--picture-card,
    .el-upload-list__item {
      width: 80px;
      height: 80px;
      line-height: 88px;
    }
    .el-tag+.el-tag {
      margin-left: 10px;
    }
    .button-new-tag {
      margin-left: 10px;
      height: 32px;
      line-height: 30px;
      padding-top: 0;
      padding-bottom: 0;
    }
    .input-new-tag {
      width: 90px;
      margin-left: 10px;
      vertical-align: bottom;
    }
  }
</style>

